package y23.Oct;

import java.util.ArrayList;
import java.util.Scanner;

public class Test20 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
        while(true){
            int n = in.nextInt();
            int count = 0;
            while(n>0) {
                if(n%2 == 1){
                    count++;
                }
                n/=2;
            }
            System.out.println(count);
        }
    }

}
